<template>
		<!-- 商品列表区 -->
		<view class="goods_list">
			<view class="goods_item" v-for="item in goods" :key="item.id">
				<image :src="item.img_url"></image>
				<view class="price">
					<text>￥{{item.sell_price}}</text>
					<text>￥{{item.market_price}}</text>
				</view>
				<view class="name">{{item.zhaiyao}}</view>
			</view>
		</view>
</template>

<script>
	export default({
		props:{
			goods:Array,
		},
	})
	
</script>

<style lang="scss">
	.goods_list{
			padding: 0 15rpx; //上下0，左右15rpx
			display: flex;//横向布局
			flex-wrap: wrap;//自动换行
			justify-content: space-between;//两边贴边对齐
			.goods_item{
				background: #FFFFFF;
				width: 355rpx;//单个商品项的宽度
				margin: 10rpx 0;//上下10rpx,左右0
				padding: 15rpx;
				box-sizing: border-box;//盒子不会被撑大
				image{
					width: 80%;
					height: 150rpx;
					display:block;//设置为block，方便居中
					margin: auto;//auto:图片居中效果
				}
				.price{
					color: $shop-color;
					font-size: 36rpx;
					margin:20rpx,0,5rpx,0;//和图片上下有一定间距
					text:nth-child(2){
						color: #C0C0C0;
						font: 20rpx;
						margin-left: 17rpx;
						text-decoration: line-through;//中划线
					}
				}
				.name{
					font-size: 28rpx;
					line-height: 50rpx;
					padding-top: 10rpx;
					padding-bottom: 15rpx;
				}
			}
		}
	
</style>
